package practice07;

import com.google.common.base.Strings;

public class Teacher extends Person{
    private Klass klass;
    private String string;

    public Teacher(String name, int age, Klass klass) {
        super(name, age);
        this.klass = klass;
        string ="My name is "+getName()+". I am "+getAge()+" years old. I am a Teacher. I teach Class "+getKlass().getNumber()+".";
    }

    public Teacher(String name, int age) {
        super(name, age);
        string ="My name is "+getName()+". I am "+getAge()+" years old. I am a Teacher. I teach No Class.";
    }

    public Klass getKlass() {
        return klass;
    }

    public void setKlass(Klass klass) {
        this.klass = klass;
    }
    public String introduce() {
        return string;
    }
    public String introduceWith(Student student){
        String string = null;
        if (klass != student.getKlass()){
            string = "My name is "+this.getName()+". I am "+this.getAge()+" years old. I am a Teacher. I don't teach "+student.getName()+".";
        }else if (klass == student.getKlass()){
            string = "My name is "+this.getName()+". I am "+this.getAge()+" years old. I am a Teacher. I teach "+student.getName()+".";
        }
        return string;
    }

    @Override
    public String toString() {
        return "Teacher{" +
                "klass=" + klass +
                '}';
    }
}
